package com.entidades.bdd;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity 
@Table(name = "Job")
@NamedQuery(name = "Job.findAll", query = "SELECT c FROM Job c")
public class Job extends BaseObject implements Serializable {
	
	/**
     * 
     */
    private static final long serialVersionUID = 44444L;
	private double salery;
	private String jobDescr;
	@ManyToOne
	private Person person;
	
	
	public double getSalery() {
		return salery;
	}
	
	public void setSalery(double salery) {
		this.salery = salery;
	}
	
	public String getJobDescr() {
		return jobDescr;
	}
	
	public void setJobDescr(String jobDescr) {
		this.jobDescr = jobDescr;
	}
	
	

	public Person getPerson() {
    	return person;
    }

	public void setPerson(Person person) {
    	this.person = person;
    }

	@Override
    public String toString() {
	    return "Job [id="+getId()+", salery=" + salery + ", jobDescr=" + jobDescr + "]";
    }

	@Override
    public boolean equals(Object obj) {
	    if (this == obj)
		    return true;
	    if (obj == null)
		    return false;
	    if(!(obj instanceof Job))
	    	return false;
	    if (getId() != ((BaseObject)obj).getId())
		    return false;
	 return true;
    }
	
	
	
}
